<!DOCTYPE html>
<html lang="en" ng-app="app">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="js/1.4.8/angular.js"></script>
</head>
<body>
<div ng-controller="myCtrl">
    <div>绝对地址：{{absUrl}}</div>
    <div>协议名称：{{protocol}}</div>
    <div>请求主机：{{host}}</div>
    <div>请求端口：{{port}}</div>
</div>
<script type="text/javascript">
    var app = angular.module("app", [])
            .controller("myCtrl",["$scope","$location",function ($scope,$location) {
                $scope.absUrl = $location.absUrl();
                $scope.protocol = $location.protocol();
                $scope.host = $location.host();
                $scope.port = $location.port();
            }]);
</script>
</body>
</html>